package oop3;

/**
 * @author oldliu
 * @since 1.0
 */
public class Dog {
    String name;
    int age;
    String type;

    public Dog() {

    }

    //    public Dog(String name, int age, String type) {
//        this.name = name;
//        this.age = age;
//        this.type = type;
//        //构造完成，显示一下
//        this.show();
//    }
    public Dog(String name, int age, String type) {
        //!!!Dog(name);//!!!
        this(name);
        this.age = age;
        this.type = type;
        //构造完成，显示一下
        this.show();
    }

    public Dog(String n) {
        System.out.println("一个参数的构造方法");
        name = n;
    }

    public Dog(String n, int a) {
        name = n;
        age = a;
    }

    //    public  Dog(String t,int a){
//        type=t;
//        age=a;
//    }
    public Dog(int a, String t) {
        type = t;
        age = a;
    }

    public void show() {
        System.out.println("这条狗叫" + name);
        System.out.println("今年" + age + "岁了");
        System.out.println("品种是" + type);
    }
}
